ddr: fsl: incorrect logical constraint in populate_memctl_options
author[email protected] <[email protected]>
Sat, 15 Apr 2017 13:23:49 +0000 (15:23 +0200)
committerTom Rini <[email protected]>
Tue, 18 Apr 2017 14:29:24 +0000 (10:29 -0400)
(pdimm[0].data_width >= 32) || (pdimm[0].data_width <= 40)
is always true.

We should use && here.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Reviewed-by: York Sun <[email protected]>
drivers/ddr/fsl/options.c

index d6a8fcb216a491869368ce9674d09a4cdec7a6ce..cee97fe23233d313cedc06b64d4d1349e0c2efe1 100644 (file)
@@ -916,7 +916,7 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,
                if ((pdimm[0].data_width >= 64) && \
                        (pdimm[0].data_width <= 72))
                        popts->data_bus_width = 0;
-               else if ((pdimm[0].data_width >= 32) || \
+               else if ((pdimm[0].data_width >= 32) && \
                        (pdimm[0].data_width <= 40))
                        popts->data_bus_width = 1;
                else {